//
//  FinishCheckSearchCell.m
//  ICrEAM
//
//  Created by mac on 16/11/4.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "FinishCheckSearchCell.h"
#import "ProxyButton.h"
@interface FinishCheckSearchCell()
@property (weak, nonatomic) IBOutlet UIImageView *consultantImageView;
@property (weak, nonatomic) IBOutlet UIImageView *customerImageView;
@property (weak, nonatomic) IBOutlet UILabel *estimateTimeL;
@property (weak, nonatomic) IBOutlet UILabel *lisenceL;
@property (weak, nonatomic) IBOutlet UILabel *serviceNameL;
@property (weak, nonatomic) IBOutlet UILabel *servicePhoenL;
@property (weak, nonatomic) IBOutlet UILabel *checkStatusL;
@property (weak, nonatomic) IBOutlet UILabel *customL;
@property (weak, nonatomic) IBOutlet UILabel *customPhoen;
@property (weak, nonatomic) IBOutlet UILabel *statusL;

@property (weak, nonatomic) IBOutlet ProxyButton *preViewBtn;
@end
@implementation FinishCheckSearchCell
+(instancetype)createFinishCheckSearchCell{
    return [[[NSBundle mainBundle]loadNibNamed:@"FinishCheckSearchCell" owner:nil options:nil]lastObject];
}
- (IBAction)detailBtnClick:(id)sender {
    if (self.detailBlock) {
        self.detailBlock(self.checkModel);
    }
}
- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle=UITableViewCellSelectionStyleNone;
    [self.preViewBtn setTitleColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
    [self.preViewBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    if (![ICrEAMTool isVW]) {
        self.customerImageView.image=[UIImage imageNamed:@"customer_sk"];
        self.consultantImageView.image=[UIImage imageNamed:@"consultant_sk"];
//        [self.preViewBtn setImage:[UIImage imageNamed:@"lookproxy_image_sk"] forState:UIControlStateNormal];
    }
    [self.preViewBtn setImage:[UIImage imageNamed:Common_Preview] forState:UIControlStateNormal];
    
    // Initialization code
}
-(void)setCheckModel:(FinishListRespose *)checkModel{
    _checkModel=checkModel;
    self.lisenceL.text=checkModel.license;
    self.estimateTimeL.text=checkModel.endTimeSupposed;
    self.serviceNameL.text=checkModel.serviceAdvisor;
    self.servicePhoenL.text=checkModel.serviceAdvisorMobile;
    self.customL.text=checkModel.delivery;
    self.customPhoen.text=checkModel.deliveryMobile;
    //  ParameterModel *model=[ICrEAMTool getParameterWithCode:checkModel.RO_STATUS];
    self.checkStatusL.text=checkModel.hasQualityCheck;
    if (checkModel.isEdit) {
        self.statusL.text=@"待终检";
        self.preViewBtn.enabled=NO;
        
    }else{
        self.statusL.text=@"已终检";
        self.preViewBtn.enabled=YES;
    }
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

@end
